﻿using System;
using System.Web;
using System.Web.Services;
using System.Web.Services.Protocols;
using System.Collections.Generic;
using System.Data;
using System.Data.SqlClient;
using System.Configuration;
using System.EnterpriseServices;
using Nojin.Deployment;


[WebService(Namespace = "http://www.barsasoft.ir/")]
[WebServiceBinding(ConformsTo = WsiProfiles.BasicProfile1_1)]
public class UpdateService : System.Web.Services.WebService
{
    [WebMethod]
    public UpdateInfoProxy GetNewReleaseInfo(int major,int minor,int build,int revision)
    {
        Version lastVersion = new Version("3.0.0.1");

        Version userVersion = new Version(major,minor,build,revision);

        if (lastVersion > userVersion)
        {

            UpdateInfoProxy result = new UpdateInfoProxy();
            result.Arbitary = true;
            result.SilentUpdate = false;
            result.ChangeLogFilePath = "http://localhost/updates/821011.html";
            result.Description = "این نسخه حاوی بعضی تغییرات آزمایشی در بعضی قسمت ها است.";
            result.ManifestPath = "http://localhost/updates/821011.xml";
            result.Name = "نسخه آزمایشی 2";
            result.PackageSize = 100;
            result.ReleaseDate = DateTime.Now;
            result.Version = "3.0.0.1";
            return result;

        }

        else
        {
            return null;
        }
    }
}